<?php


namespace app\api\model;


use think\Model;

/**
 * 用户表
 * Class User
 * @package app\api\model
 */
class User extends Model
{
    /**
     * 用户列表
     * @param $param
     * @param array $where
     * @return \think\Paginator
     * @throws \think\db\exception\DbException
     */
    public function getUserList($param, $where = [])
    {
        $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
        $order = empty($param['order']) ? 'id desc' : $param['order'];
        $list = $this->where($where)->order($order)->paginate($rows, false, ['query' => $param]);
        return $list;
    }
}